
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .activited{
            color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <div @click="handleClick"
             :class="{activited:isActivited}"
        >ruijie</div>
    </div>
</body>
<!-- push pop shift unshift splice sort reverse vue.set app.$set-->
<script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.js"></script>
<script>
    var app = new Vue({
        el:"#app",
        data(){
            return {
                isActivited:false
            }
        },
        methods:{
            handleClick(){
                this.isActivited = !this.isActivited;
            }
        }
    })
</script>
</html>